package btb.net;

import com.esotericsoftware.kryonet.Connection;

import btb.util.CLogger;

public class CUser extends ANetDossier
{
	public class NUserProfile extends NANetProfile
	{
		public NUserProfile()
		{
			super();
		}
		
		public NUserProfile(CUser _user, String _username)
		{
			super(_user, _username);
		}
	}
	
	private NUserProfile profile;
	private Connection conn;
	
	public CUser(String _username, Connection _conn)
	{
		profile = new NUserProfile(this, _username);
		conn = _conn;
	}
	
	@Override
	public void setProfile(NANetProfile _profile)
	{
		try
		{
			profile = (NUserProfile) _profile;
			profile.setOwner(this);
		}
		catch(Exception e)
		{
			CLogger.cond_error("engine/net", "Attempted to set profile object for CUser object; general Exception thrown.");
		}
	}

	@Override
	public NANetProfile getProfile()
	{
		return profile;
	}
	
	public Connection getConnection(){return conn;}
	//private void setConnection(Connection _conn){conn = _conn;}
}
